<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddFieldsToVehicleSeriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('vehicle_series', function (Blueprint $table) {
            $table->string('poster')->nullable()->comment('品系介绍图');
            $table->boolean('recommend')->default(false)->comment('是否参与推荐有礼');
            $table->string('recommend_poster')->nullable()->comment('推荐有礼海报背景');
            $table->integer('clue_point')->default(0)->comment('留资获得积分数');
            $table->integer('driver_point')->default(0)->comment('试驾获得积分数');
            $table->integer('buy_car_point')->default(0)->comment('购车获得积分数');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('vehicle_series', function (Blueprint $table) {
            $table->dropColumn('poster');
            $table->dropColumn('recommend');
            $table->dropColumn('recommend_poster');
            $table->dropColumn('clue_point');
            $table->dropColumn('driver_point');
            $table->dropColumn('buy_car_point');
        });
    }
}
